(function(lib,config){
var loadFunc=function(){
	var bgcolorAry=config.bgcolor.split('|'),imglinkAry=config.imglink.split('|'),textAry=config.words.split('|'),textcolorAry=config.textcolor.split('|');
	bgcolorAry[0]=bgcolorAry[0]||'#2E2E32';
	imglinkAry[0]=imglinkAry[0]||'/attachment/images/db-p1.jpg';
	textAry[0]=textAry[0]||'三甲名医专家在线解答';
	textAry[1]=textAry[1]||"您好，我是今日值班在线医生，<img src=\'/images/smile0.gif\' width=\'24\' class=\'ly-animation-bell on\'>请问有什么可以帮助到你的？";
	textAry[2]=textAry[2]||'请输入您想要咨询的问题...';
	textcolorAry[0]=textcolorAry[0]||'#fff';
	textcolorAry[1]=textcolorAry[1]||'#323232';
	
	var htmlStr=[
  "<style>",
".all_mid,.all_mid *{ padding:0; margin:0;}",
".all_mid { box-sizing: border-box; -webkit-box-sizing: border-box; margin: 0 auto; font-family: \'微软雅黑\'; font-size: 13px; }",
".ly-header { width: 100%;overflow: hidden; padding-bottom: 0;position:relative; background:{{bgcolor}};}",
".ly-header div { height: 40px; background: {{bgcolor}}; overflow:hidden; }",
".ly-header a{ vertical-align:top;}",
".ly-header div a i { float: right; width: 1px; height: 20px; margin: 10px 0 0 0;}",
".ly-header div p { color: {{textcolor1}}; font-size:16px; height: 40px; line-height: 40px; margin:0; background:{{bgcolor}};}",
".ly-header div a:nth-child(2) { float: right; width: 50px; line-height:40px; text-align:center; font-size:30px; color:#fff; height: 40px; background:{{bgcolor}}; }",
".ly-section1 { background: #ebebeb; padding: 1px 0 5px 0; }",
".ly-section1 .db-line { margin: 0 0 0 10px; }",
".ly-section1 .left { float: left; max-width: 90%; margin: 4px 0 0 0; }",
".ly-section1 .left div { position: relative; margin: 0 0 0 55px; padding: 5px; background: #FFF; color: #323232; border: 1px solid #d5d5d5; border-radius: 6px; }",
".time { font-size: 13px; color: #fff; text-align: center; margin-top: 5px; margin-left: 45%; border-radius: 3px; width:60px; height: 20px; line-height: 20px; background: #ccc; overflow: hidden; }",
".ly-section1 .left div i { position: absolute; top: 2px; left: -20px; width: 20px; height: 20px; background: url(/images/wechat.png) no-repeat scroll 0 -200px; transform: rotate(-180deg) }",
".ly-section1 .left img { float: left; margin: 0px 2px 0 0; border-radius:50%;width:auto; }",
".ly-section1 .left div img { float: none; width: 24px; }",
".ly-section1 figure { width: 95%; margin: 3px auto; overflow: hidden; border-bottom: 1px solid #CCCCCC; }",
".ly-section1 .zzh { width: 100%; float: left; display: block; margin-bottom: 15px; }",
".ly-section1 figcaption { width: 68%; float: left; margin-left: 2%; }",
".ly-footer {width: 100%; height: 50px; background: #FFF; border-top: 1px solid #bfbfbf }",
".ly-footer .azf1 a { float: left; width: 50px; height: 50px; background: url(/images/wechat.png) no-repeat scroll 9px -89px; }",
".ly-footer .azf2 textarea { float: left; width: 82%; height: 36px; margin: 7px 0 0 0px; color: {{textcolor3}}; font-size: 13px; line-height: 35px; border: none; border-bottom: 1px solid #d8d8d8; transition: 0.3s; resize: none; outline: none; }",
".ly-footer .azf2 textarea:focus { border: none; border-bottom: 1px solid #45c01a; }",
".ly-footer .azf2 textarea.on { border-bottom: #45c01a }",
".ly-footer .azf2 i { }",
".ly-footer .azf1{  width: 50px; float:left}",
".ly-footer .azf2{ width: 63%; float: left;  }",
".ly-footer .azf3  {   width: 67px; float:right }",
".ly-footer .azf3 a { float: right; margin-right: 10px; width:58px; height: 35px; margin-top: -40px; margin: 7px 5px 0 0; background: #45c01a; color: #FFF; text-align: center; line-height: 35px; border-radius: 5px; cursor: pointer; transition: 0.3s; }",
".ly-footer .azf3 a:hover { background-color: #3aa814; }",
".ly-clear { clear: both; }",
".ly-hide { display: none; }",
".ly-animation-bell { display: inline-block; color: #F00; transition: 0.5s; }",
".ly-animation-bell.on { animation: ly-animation-bell 0.5s; }",
"#pfjw { width: 100%; z-index: 9999999; left: 0; bottom: 0; position: fixed; display: none; }",
"#pfjw .closePop { line-height: 35px; font-size: 30px; text-decoration: none; color: #fff; text-align: center; float: left; width: 50px; height: 40px; background: url(/images/wechat.png) no-repeat 20px 12px; }",
"#pfjw .closePop img { margin: 2px auto; display: block; }",
"@keyframes ly-animation-bell { 0% {",
"transform:rotate(-5deg);",
"}",
"20% {",
"transform:rotate(10deg);",
"}",
"40% {",
"transform:rotate(-15deg);",
"}",
"60% {",
"transform:rotate(20deg);",
"}",
"80% {",
"transform:rotate(-15deg);",
"}",
"100% {",
"transform:rotate(10deg);",
"}",
"}",
"#LRfloater1 { z-index: 99999!important }",
"}",
"",
"</style>",
"",
"",
"<div class=\'all_zx\' id=\'pfjw\'>",
"    <div class=\'all_mid\'>",
"        <div class=\'ly-header\'><a onclick=\'toolclose();\' class=\'closePop\'></a>",
"            <div><a><i></i></a><a onclick=\'toolclose();\'>×</a>",
"                <p>{{text1}}</p>",
"            </div>",
"        </div>",
"        <div id=\'toopl\' class=\'shadow\'></div>",
"        <div class=\'ly-section1\' id=\'frist\'>",
"            <div id=\'now44\' class=\'time\'></div>",
"            <dl id=\'tools3\'>",
"                <div class=\'db-line ly-hide\' style=\'display: block; opacity: 1.08347;\'>",
"                    <div class=\'left\'><img src=\'{{imglink}}\' style=\'width:40px;\'>",
"                        <div><i></i><a href=\'javascript:void(0);\' onclick=\'openZoosUrl(\"dibu_tan\")\' style=\'color:{{textcolor2}};\'>{{text2}}</a></div>",
"                    </div>",
"                    <div class=\'ly-clear\'></div>",
"                </div>",
"            </dl>",
"        </div>",
"        <div style=\'padding:0;margin-top: 0;margin-bottom: 0px;\' class=\'ly-footer\'>",
"            <div class=\'azf1\'><a href=\'javascript:void(0);\' onclick=\'openZoosUrl(\"dibu_tan\")\'></a></div>",
"            <div class=\'azf2\'>",
"                <a href=\'javascript:void(0);\' onclick=\'openZoosUrl(\"dibu_tan\")\'><textarea id=\'xiu\' onclick=\'openZoosUrl()\' class=\'textareathis container\'>请</textarea></a>",
"                <i></i></div>",
"            <div class=\'azf3\'><a href=\'javascript:void(0);\' onclick=\'openZoosUrl(\"dibu_tan\")\'>发送</a></div>",
"        </div>",
"    </div>",
"</div>"
].join('');
htmlStr=lib.util.resolveTemplate(htmlStr,'bgcolor',bgcolorAry[0],'imglink',imglinkAry[0],'text1',textAry[0],'text2',textAry[1],'textcolor1',textcolorAry[0],'textcolor2',textcolorAry[1],'textcolor3',textcolorAry[2]);
document.body.innerHTML+=htmlStr;
 function nowTime(_obj){
		var now = new Date();
		var hh = now.getHours();
		var mm = now.getMinutes();
		var ss = now.getSeconds();
		function getDateWeek(obj) {if (obj < 10) return "0" + obj; else return obj;}
		_obj.innerHTML = getDateWeek(hh) + ":" + getDateWeek(mm) + ":" + getDateWeek(ss);
}

var date2 = document.getElementById("now44");
setTimeout(function(){nowTime(date2);},2000)

var frist = document.getElementById("pfjw");
var toopl = document.getElementById("toopl");
var tools3 = document.getElementById("tools3");
// UPDATE config.firsttime 第一次拉开时间
setTimeout("toolshow()", config.firsttime*1000);
toolshow = function() {
    frist.style.display = "block";
    var screenheight = window.screen.height;
    if (screenheight <= 480) {
        var allmid = document.getElementsByClassName('all_mid')[0];
        allmid.style.cssText = "font-size:12px !important;";
    };
	// UPDATE config.eachtime 拉开后显示停留时间
	if(config.eachtime>0)setTimeout(toolclose, config.eachtime*1000);

};
toolshow3 = function() {
    tools3.style.display = "block";
};
toolclose = function() {
    frist.style.display = "none";
    toopl.style.display = "none";
	// UPDATE config.relapsetime 关闭后再次拉开时间
    if(config.relapsetime>0)setTimeout(toolshow, config.relapsetime*1000);
};

var s = textAry[2];
var con = $('.container');
var index = 0;
var length = s.length;
var tId = null;
function startshuru() {
    con.text('');
    con.append('<span></span>');
    tId = setInterval(function() {
        con.append(s.charAt(index));
        if (index++===length) {
            clearInterval(tId);
            index = 0;
            startshuru()
        }
    },
    400);
}
startshuru();
$("#xiu").focus(function() {
    $(this).val('');
});
}
lib.load(loadFunc);
})('{{lib}}','{{config}}');